import {
    Routes,
    Route
} from 'react-router-dom';
import { Suspense, lazy } from 'react';
// 引入页面路径
const Home = lazy(() => import('../pages/Home'));
const Detail = lazy(() => import('../pages/Detail'));
const Center = lazy(() => import('../pages/Center'));


const Routers  = () => {
    return (
        <Suspense fallback={<h1>Loading....</h1>}>
            <Routes>
                <Route path="/" element={<Home/>}></Route>
                <Route path="/detail/:id" element={<Detail />}></Route>
                <Route path="/center" element={<Center />}></Route>
            </Routes>
        </Suspense>
    )
}

export default Routers;